package com.weimob.mcloud.wechatwork.customer.convertor.customer;

import com.weimob.mcloud.wechatwork.core.adapter.pojo.dto.passport.response.PassPortAccountMappingRes;
import org.apache.commons.collections.CollectionUtils;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class PassportMappingCovert {

    public static Set<String> toExternalUserIds(List<PassPortAccountMappingRes> list) {
        if (CollectionUtils.isEmpty(list)) {
            return new HashSet<>();
        }

        Set<String> set = new HashSet<>();
        for (PassPortAccountMappingRes object : list) {
            set.add(object.getExternalUserId());
        }

        return set;
    }
}
